Skip to content

[#331] Combine create + chain into tabbed page with Add Plot shortcut#333

Merged
realproject7 merged 3 commits intomainfrom
task/331-combine-create-chain
Mar 18, 2026
Merged

[#331] Combine create + chain into tabbed page with Add Plot shortcut#333
realproject7 merged 3 commits intomainfrom
task/331-combine-create-chain

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Tabbed /create page: [New] and [Add Plot] tabs on a unified page
  • Query param support: ?tab=chain selects Add Plot tab; ?storyline=<id> prefills the storyline selector
  • /chain redirect: Old /chain page now redirects to /create?tab=chain
  • NavBar cleanup: Removed separate "chain" nav link
  • AddPlotButton: Writer-only button on story detail page (below deadline countdown), links to /create?tab=chain&storyline={id}

5 files changed. Both forms preserve existing behavior.

Fixes #331

Test plan

  • npm run build passes
  • npm run typecheck passes
  • Verify /create shows New tab by default with storyline form
  • Verify /create?tab=chain shows Add Plot tab with chain form
  • Verify /create?tab=chain&storyline=1 prefills storyline selector
  • Verify /chain redirects to /create?tab=chain
  • Verify NavBar no longer shows "chain" link
  • Verify AddPlotButton only appears for connected writer on story detail

- Unified /create page with [New] and [Add Plot] tabs
- New tab: full create storyline form (unchanged behavior)
- Add Plot tab: chain plot form with storyline selector
- ?tab=chain and ?storyline=<id> query params auto-select and prefill
- /chain now redirects to /create?tab=chain
- Removed "chain" link from NavBar
- Added AddPlotButton client component on story detail page,
  visible only to the connected writer, links to /create?tab=chain

Fixes #331

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b REQUEST CHANGES

Blocking: src/app/chain/page.tsx discards query params on redirect. The comment says "Forward any query params" but void searchParams explicitly drops them, so /chain?storyline=123/create?tab=chain (loses storyline=123).

Fix: await searchParams and forward them:

export default async function ChainRedirect({
  searchParams,
}: {
  searchParams: Promise<Record<string, string>>;
}) {
  const params = await searchParams;
  const qs = new URLSearchParams(params).toString();
  redirect("/create?tab=chain" + (qs ? "&" + qs : ""));
}

Everything else looks correct:

  • Tabbed page with query param support ✅
  • AddPlotButton writer-only check ✅
  • NavBar chain link removed ✅
  • Published states scoped per tab ✅
  • No state leakage between tabs ✅

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The tabbed /create consolidation is close, but the backward-compat redirect for /chain drops incoming query params, which breaks deep links into the Add Plot flow.

Findings

  • [high] /chain does not forward storyline (or any other) query params despite the comment saying it does.
    • File: src/app/chain/page.tsx:8
    • Suggestion: Preserve the incoming search params when redirecting, e.g. redirect /chain?storyline=123 to /create?tab=chain&storyline=123. As written, old links lose the preselected storyline and no longer satisfy the deep-link/prefill behavior.

Decision

Request changes. The redirect needs to preserve query params so the old chain entry points continue to land on the correct prefilled Add Plot state.

Await searchParams and forward all params (e.g. storyline=123)
to /create?tab=chain&storyline=123 so old deep links still work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Blocker fixed: /chain redirect now awaits searchParams and forwards all query params (excluding tab). /chain?storyline=123/create?tab=chain&storyline=123

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up fixes the backward-compat redirect so old /chain deep links preserve their query params when landing on the unified /create flow. The combined create/chain experience now matches issue #331.

Findings

  • [low] The prior blocker is resolved: /chain now forwards incoming search params into /create?tab=chain..., so old storyline deep links still prefill the Add Plot tab correctly.
    • File: src/app/chain/page.tsx:8
    • Suggestion: None.

Decision

Approve. The tabbed /create flow, writer-only story shortcut, nav cleanup, and redirect behavior now align with the requested scope, and local npm run build plus npm run typecheck both pass.

The initial useState already reads from the query param, so the
effect was redundant. Removes the set-state-in-effect lint violation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up removes the lint-blocking state update effect without changing the approved behavior. The unified /create flow and /chain redirect remain correct on the current head.

Findings

  • [low] The storyline prefill now relies on initial query-param state instead of an effect, which avoids the react-hooks/set-state-in-effect lint violation while preserving the expected deep-link behavior.
    • File: src/app/create/page.tsx:99
    • Suggestion: None.

Decision

Approve. The current PR head remains within issue #331 scope, and local npm run build plus npm run typecheck both pass.

@realproject7 realproject7 merged commit 6be5234 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine create + chain into one tabbed page with Add Plot shortcut on story detail

2 participants